package com.gt.quality.system.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * 角色信息表(SysRole)表实体类
 *
 * @author makejava
 * @since 2026-11-25 16:30:08
 */
@Data
@Accessors(chain = true)
@Schema(title = "SysRole", description = "EasyCode")
@TableName(value = "sys_role", autoResultMap = true)
public class SysRole implements Serializable {
	@Serial
    private static final long serialVersionUID = 1L;

    /**
     * Description:  角色ID
     */
    @Schema(title = "role_id",description = "角色ID")
    @TableId(value = "role_id", type = IdType.ASSIGN_ID)
    @JsonSerialize(using= ToStringSerializer.class)
    @JsonProperty("id")
    private Long roleId;

    /**
     * Description:  租户编号
     */
    @TableField(value = "tenant_id")
    @Schema(title = "tenant_id",description = "租户编号")
    private String tenantId;

    /**
     * Description:  角色名称
     */
    @TableField(value = "role_name")
    @Schema(title = "role_name",description = "角色名称")
    private String roleName;

    /**
     * Description:  角色权限字符串
     */
    @TableField(value = "role_key")
    @Schema(title = "role_key",description = "角色权限字符串")
    private String roleKey;

    /**
     * Description:  显示顺序
     */
    @TableField(value = "role_sort")
    @Schema(title = "role_sort",description = "显示顺序")
    private Integer roleSort;

    /**
     * Description:  数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）
     */
    @TableField(value = "data_scope")
    @Schema(title = "data_scope",description = "数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）")
    private String dataScope;

    /**
     * Description:  菜单树选择项是否关联显示
     */
    @TableField(value = "menu_check_strictly")
    @Schema(title = "menu_check_strictly",description = "菜单树选择项是否关联显示")
    private Integer menuCheckStrictly;

    /**
     * Description:  部门树选择项是否关联显示
     */
    @TableField(value = "dept_check_strictly")
    @Schema(title = "dept_check_strictly",description = "部门树选择项是否关联显示")
    private Integer deptCheckStrictly;

    /**
     * Description:  角色状态（0正常 1停用）
     */
    @TableField(value = "status")
    @Schema(title = "status",description = "角色状态（0正常 1停用）")
    private String status;

    /**
     * Description:  删除标志（0代表存在 2代表删除）
     */
    @TableField(value = "del_flag")
    @Schema(title = "del_flag",description = "删除标志（0代表存在 2代表删除）")
    private String delFlag;

    /**
     * Description:  创建部门
     */
    @TableField(value = "create_dept")
    @Schema(title = "create_dept",description = "创建部门")
    private Long createDept;

    /**
     * Description:  创建者
     */
    @TableField(value = "create_by")
    @Schema(title = "create_by",description = "创建者")
    private Long createBy;

    /**
     * Description:  创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @Schema(title = "create_time",description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     * Description:  更新者
     */
    @TableField(value = "update_by")
    @Schema(title = "update_by",description = "更新者")
    private Long updateBy;

    /**
     * Description:  更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    @Schema(title = "update_time",description = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     * Description:  备注
     */
    @TableField(value = "remark")
    @Schema(title = "remark",description = "备注")
    private String remark;

}


